package com.shadow.ui.objects
{
	import com.shadow.constant.ItemType;
	import com.shadow.constant.SystemKey;
	import com.shadow.dataentities.systemdata.AssetEntity;
	import com.shadow.ui.objects.base.Asset;
	import com.shadow.ui.objects.building.BasicBuilding;

	public final class AssetFactory
	{
		public function AssetFactory()
		{
		}
		/**
		 *创建资源 
		 * @param item		资源数据
		 * @param userData	用户数据
		 * @return 			资源
		 * 
		 */		
		public static function createAsset(item:AssetEntity, userData:Object):Asset
		{
			var asset:Asset;
			switch(item.system_key)
			{
				case SystemKey.BUILDING_SYSTEM_KEY:
					switch(item.item_type){
						case ItemType.BUILDING_BASIC:
							asset = new BasicBuilding(item,userData);
							break;
					}
				break;
				case SystemKey.CHARACTER_SYSTEM_KEY:
					break;
				
			}
			
			return asset;
		}
	}
}